#ifndef SHADER_H
#define SHADER_H


#include"Vertex.h"
#include"Model.h"
#include"MyMath.h"



class Shader
{
public:
	virtual void VS(Vertex& v0, Vertex& v1, Vertex& v2)=0;
	virtual bool FS(Vertex& v, Vec4f g) = 0;

};


class PhongShader : public Shader {
public:
	PhongVert vert;
	PhongFrag frag;

	PhongShader(PhongVert _vert, PhongFrag _frag) :vert(_vert), frag(_frag) {}
	~PhongShader() {}

	virtual void VS(Vertex& v0, Vertex& v1, Vertex& v2) override;//vertexshader
	virtual bool FS(Vertex& v, Vec4f g)override;//fragment shader
	float CalcShadow(Vec4f& lightSpace, double bias);
};



class ShadowShader :public Shader {
public:
	ShadowVert vert;

	ShadowShader(){}
	~ShadowShader() {}

	virtual void VS(Vertex& v0, Vertex& v1, Vertex& v2) override;
	virtual bool FS(Vertex& v, Vec4f g)override;
};














#endif SHADER_H



